home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / performCreatePhong.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  17.4 KB  |  541 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  5 June, 1997
  22. //  Author:         jb
  23. //
  24. //  Description:
  25. //      This script is a template script for option box dialogs.
  26. //
  27. //  Input Arguments:
  28. //      None.
  29. //
  30. //  Return Value:
  31. //      None.
  32. //
  33.  
  34. proc setOptionVars (int $forceFactorySettings)
  35. {
  36.     if( $forceFactorySettings || !`optionVar -exists phongRed` ) {
  37.         optionVar -floatValue phongRed 0.5;
  38.     } 
  39.     if( $forceFactorySettings || !`optionVar -exists phongGreen` ) {
  40.         optionVar -floatValue phongGreen 0.5;
  41.     } 
  42.     if( $forceFactorySettings || !`optionVar -exists phongBlue` ) {
  43.         optionVar -floatValue phongBlue 0.5;
  44.     } 
  45.     if( $forceFactorySettings || !`optionVar -exists phongTransRed` ) {
  46.         optionVar -floatValue phongTransRed 0.0;
  47.     } 
  48.     if( $forceFactorySettings || !`optionVar -exists phongTransGreen` ) {
  49.         optionVar -floatValue phongTransGreen 0.0;
  50.     } 
  51.     if( $forceFactorySettings || !`optionVar -exists phongTransBlue` ) {
  52.         optionVar -floatValue phongTransBlue 0.0;
  53.     } 
  54.     if( $forceFactorySettings || !`optionVar -exists phongAmbientRed` ) {
  55.         optionVar -floatValue phongAmbientRed 0.0;
  56.     } 
  57.     if( $forceFactorySettings || !`optionVar -exists phongAmbientGreen` ) {
  58.         optionVar -floatValue phongAmbientGreen 0.0;
  59.     } 
  60.     if( $forceFactorySettings || !`optionVar -exists phongAmbientBlue` ) {
  61.         optionVar -floatValue phongAmbientBlue 0.0;
  62.     } 
  63.     if( $forceFactorySettings || !`optionVar -exists phongIncandRed` ) {
  64.         optionVar -floatValue phongIncandRed 0.0;
  65.     } 
  66.     if( $forceFactorySettings || !`optionVar -exists phongIncandGreen` ) {
  67.         optionVar -floatValue phongIncandGreen 0.0;
  68.     } 
  69.     if( $forceFactorySettings || !`optionVar -exists phongIncandBlue` ) {
  70.         optionVar -floatValue phongIncandBlue 0.0;
  71.     } 
  72.     if( $forceFactorySettings || !`optionVar -exists phongSpecularRed` ) {
  73.         optionVar -floatValue phongSpecularRed 0.0;
  74.     } 
  75.     if( $forceFactorySettings || !`optionVar -exists phongSpecularGreen` ) {
  76.         optionVar -floatValue phongSpecularGreen 0.0;
  77.     } 
  78.     if( $forceFactorySettings || !`optionVar -exists phongSpecularBlue` ) {
  79.         optionVar -floatValue phongSpecularBlue 0.0;
  80.     } 
  81.     if( $forceFactorySettings || !`optionVar -exists phongCosinePower` ) {
  82.         optionVar -floatValue phongCosinePower 20.0;
  83.     } 
  84.     if( $forceFactorySettings || !`optionVar -exists phongRoughness` ) {
  85.         optionVar -floatValue phongRoughness 0.5;
  86.     } 
  87.     if( $forceFactorySettings || !`optionVar -exists phongHighlightSize` ) {
  88.         optionVar -floatValue phongHighlightSize 0.5;
  89.     } 
  90.     if( $forceFactorySettings || !`optionVar -exists phongWhitenessRed` ) {
  91.         optionVar -floatValue phongWhitenessRed 0.5;
  92.     } 
  93.     if( $forceFactorySettings || !`optionVar -exists phongWhitenessGreen` ) {
  94.         optionVar -floatValue phongWhitenessGreen 0.5;
  95.     } 
  96.     if( $forceFactorySettings || !`optionVar -exists phongWhitenessBlue` ) {
  97.         optionVar -floatValue phongWhitenessBlue 0.5;
  98.     } 
  99.     if( $forceFactorySettings || !`optionVar -exists phongReflectivity` ) {
  100.         optionVar -floatValue phongReflectivity 0.5;
  101.     } 
  102.     if( $forceFactorySettings || !`optionVar -exists phongType` ) {
  103.         optionVar -stringValue phongType "regularPhong";
  104.     }
  105. }
  106.  
  107. global proc createPhongSetup (string $parent, int $forceFactorySettings)
  108. {
  109.     // Retrieve the option settings
  110.     //
  111.     setOptionVars( $forceFactorySettings );
  112.     
  113.     setParent $parent;
  114.     
  115.     // Query the optionVar's and set the values into the controls
  116.     //    
  117.     float $red = `optionVar -query phongRed`;
  118.     float $green = `optionVar -query phongGreen`;
  119.     float $blue = `optionVar -query phongBlue`;
  120.     colorSliderGrp -e -rgb $red $green $blue phongRGB;
  121.  
  122.     $red = `optionVar -query phongTransRed`;
  123.     $green = `optionVar -query phongTransGreen`;
  124.     $blue = `optionVar -query phongTransBlue`;
  125.     colorSliderGrp -e -rgb $red $green $blue phongTransRGB;
  126.  
  127.     $red = `optionVar -query phongAmbientRed`;
  128.     $green = `optionVar -query phongAmbientGreen`;
  129.     $blue = `optionVar -query phongAmbientBlue`;
  130.     colorSliderGrp -e -rgb $red $green $blue phongAmbientRGB;
  131.  
  132.     $red = `optionVar -query phongIncandRed`;
  133.     $green = `optionVar -query phongIncandGreen`;
  134.     $blue = `optionVar -query phongIncandBlue`;
  135.     colorSliderGrp -e -rgb $red $green $blue phongIncandRGB;
  136.  
  137.     $red = `optionVar -query phongSpecularRed`;
  138.     $green = `optionVar -query phongSpecularGreen`;
  139.     $blue = `optionVar -query phongSpecularBlue`;
  140.     colorSliderGrp -e -rgb $red $green $blue phongSpecularRGB;
  141.  
  142.     floatSliderGrp -e -v `optionVar -q phongCosinePower` phongCosinePower;
  143.     floatSliderGrp -e -v `optionVar -q phongRoughness` phongRoughness;
  144.     floatSliderGrp -e -v `optionVar -q phongHighlightSize` phongHighlightSize;
  145.  
  146.     $red = `optionVar -query phongWhitenessRed`;
  147.     $green = `optionVar -query phongWhitenessGreen`;
  148.     $blue = `optionVar -query phongWhitenessBlue`;
  149.     colorSliderGrp -e -rgb $red $green $blue phongWhitenessRGB;
  150.  
  151.     floatSliderGrp -e -v `optionVar -q phongReflectivity` phongReflectivity;
  152.  
  153.     string $phongType = `optionVar -query phongType`;
  154.     if( $phongType == "regularPhong" ) {
  155.         radioButtonGrp -e -sl 1 phongType;
  156.     } else {
  157.         radioButtonGrp -e -sl 2 phongType;
  158.     }
  159.  
  160.     //    Disable and enable some widgets, depending on the
  161.     //    setting of the regular vs explore phong buttons
  162.     //
  163.     if( $phongType == "regularPhong" ) {
  164.         floatSliderGrp -e -enable false phongRoughness;
  165.         floatSliderGrp -e -enable false phongHighlightSize;
  166.         colorSliderGrp -e -enable false phongWhitenessRGB;
  167.         floatSliderGrp -e -enable true phongCosinePower;
  168.     } else {
  169.         floatSliderGrp -e -enable true phongRoughness;
  170.         floatSliderGrp -e -enable true phongHighlightSize;
  171.         colorSliderGrp -e -enable true phongWhitenessRGB;
  172.         floatSliderGrp -e -enable false phongCosinePower;
  173.     }
  174. }
  175.  
  176. global proc createPhongCallback (string $parent, int $doIt)
  177. //
  178. // Description:
  179. //    Set the optionVar's from the control values, and then perform
  180. //    the command
  181. //
  182. {
  183.     setParent $parent;
  184.  
  185.     float $rgb[] = `colorSliderGrp -q -rgb phongRGB`;
  186.     optionVar -floatValue phongRed $rgb[0];
  187.     optionVar -floatValue phongGreen $rgb[1];
  188.     optionVar -floatValue phongBlue $rgb[2];
  189.  
  190.     $rgb = `colorSliderGrp -q -rgb phongTransRGB`;
  191.     optionVar -floatValue phongTransRed $rgb[0];
  192.     optionVar -floatValue phongTransGreen $rgb[1];
  193.     optionVar -floatValue phongTransBlue $rgb[2];
  194.  
  195.     $rgb = `colorSliderGrp -q -rgb phongAmbientRGB`;
  196.     optionVar -floatValue phongAmbientRed $rgb[0];
  197.     optionVar -floatValue phongAmbientGreen $rgb[1];
  198.     optionVar -floatValue phongAmbientBlue $rgb[2];
  199.  
  200.     $rgb = `colorSliderGrp -q -rgb phongSpecularRGB`;
  201.     optionVar -floatValue phongSpecularRed $rgb[0];
  202.     optionVar -floatValue phongSpecularGreen $rgb[1];
  203.     optionVar -floatValue phongSpecularBlue $rgb[2];
  204.  
  205.     $rgb = `colorSliderGrp -q -rgb phongIncandRGB`;
  206.     optionVar -floatValue phongIncandRed $rgb[0];
  207.     optionVar -floatValue phongIncandGreen $rgb[1];
  208.     optionVar -floatValue phongIncandBlue $rgb[2];
  209.  
  210.     optionVar -floatValue phongCosinePower `floatSliderGrp -q -v phongCosinePower`;
  211.     optionVar -floatValue phongRoughness `floatSliderGrp -q -v phongRoughness`;
  212.     optionVar -floatValue phongHighlightSize `floatSliderGrp -q -v phongHighlightSize`;
  213.  
  214.     $rgb = `colorSliderGrp -q -rgb phongWhitenessRGB`;
  215.     optionVar -floatValue phongWhitenessRed $rgb[0];
  216.     optionVar -floatValue phongWhitenessGreen $rgb[1];
  217.     optionVar -floatValue phongWhitenessBlue $rgb[2];
  218.  
  219.     optionVar -floatValue phongReflectivity `floatSliderGrp -q -v phongReflectivity`;
  220.  
  221.     int $phongType = `radioButtonGrp -q -sl phongType`;
  222.     if( $phongType == 1 ) {
  223.         optionVar -stringValue phongType "regularPhong";
  224.     } else {
  225.         optionVar -stringValue phongType "explorePhong";
  226.     }
  227.  
  228.     if( $doIt ) {
  229.         performCreatePhong 0;
  230.     }
  231. }
  232.  
  233. global proc createPhongOptions ()
  234. {
  235.     // Name of the command for this option box 
  236.     //
  237.     string $commandName = "createPhong";
  238.  
  239.     // Build the option box "methods"
  240.     //
  241.     string $callback = ($commandName + "Callback");
  242.     string $setup = ($commandName + "Setup");
  243.     
  244.     //  STEP 1:  Get the option box.
  245.     //  ============================
  246.     //
  247.     //  The value returned is the name of the layout to be used as
  248.     //  the parent for the option box UI.
  249.     //
  250.     string $layout = getOptionBox();
  251.     setParent $layout;
  252.  
  253.     //  STEP 2:  Pass the command name to the option box.
  254.     //  =================================================
  255.     //
  256.     //  Any default option box behaviour based on the command name is set
  257.     //  up with this call.  For example, updating the 'Help' menu item with
  258.     //  the name of the command.
  259.     //
  260.     setOptionBoxCommandName($commandName);
  261.  
  262.     //  STEP 3:  Activate the default UI template.
  263.     //  ==========================================
  264.     //
  265.     //  Activate the default UI template so that the layout of this
  266.     //  option box is consistent with the layout of the rest of the
  267.     //  application.
  268.     //
  269.     setUITemplate -pushTemplate DefaultTemplate;
  270.  
  271.     //  STEP 4: Create option box contents.
  272.     //  ===================================
  273.     //
  274.     //  This, of course, will vary from option box to option box.
  275.            
  276.     //  Turn on the wait cursor.
  277.     //
  278.     waitCursor -state 1;
  279.  
  280.     tabLayout -scr true -tv false;
  281.  
  282.     string $parent = `columnLayout -adjustableColumn 1`;
  283.  
  284.     //    Create the widgets for this option box
  285.     //
  286.     separator -style "none" -h 5;
  287.  
  288.     radioButtonGrp
  289.         -label "Phong Type"
  290.         -numberOfRadioButtons 2
  291.         -select 1
  292.         -la2 "Regular" "Explore"
  293.         phongType;
  294.  
  295.     radioButtonGrp -edit
  296.         -cc1 (     "floatSliderGrp -e -enable false phongRoughness; "+
  297.                 "floatSliderGrp -e -enable false phongHighlightSize; "+
  298.                 "colorSliderGrp -e -enable false phongWhitenessRGB; "+
  299.                 "floatSliderGrp -e -enable true phongCosinePower; " )
  300.         -cc2 (     "floatSliderGrp -e -enable true phongRoughness; "+
  301.                 "floatSliderGrp -e -enable true phongHighlightSize; "+
  302.                 "colorSliderGrp -e -enable true phongWhitenessRGB; "+
  303.                 "floatSliderGrp -e -enable false phongCosinePower; " )
  304.         phongType;
  305.  
  306.     colorSliderGrp
  307.         -h 25
  308.         -label "Color"
  309.         -rgb 0.5 0.5 0.5
  310.         phongRGB;
  311.  
  312.     colorSliderGrp
  313.         -h 25
  314.         -label "Transparency"
  315.         -rgb 0 0 0
  316.         phongTransRGB;
  317.  
  318.     colorSliderGrp
  319.         -h 25
  320.         -label "Ambient Color"
  321.         -rgb 0 0 0
  322.         phongAmbientRGB;
  323.  
  324.     colorSliderGrp
  325.         -h 25
  326.         -label "Incandescence"
  327.         -rgb 0 0 0
  328.         phongIncandRGB;
  329.  
  330.     separator -style "in" -h 5;
  331.  
  332.     colorSliderGrp
  333.         -h 25
  334.         -label "Specular Color"
  335.         -rgb 0.5 0.5 0.5
  336.         phongSpecularRGB;
  337.  
  338.     floatSliderGrp
  339.         -h 25
  340.         -label "Reflectivity"
  341.         -field true
  342.         -value 0.5
  343.         -min 0.0 -max 1.0
  344.         -pre 4
  345.         phongReflectivity;
  346.  
  347.     floatSliderGrp
  348.         -h 25
  349.         -label "Cosine Power"
  350.         -field true
  351.         -value 20.0
  352.         -min 2.0 -max 100.0
  353.         -pre 4
  354.         phongCosinePower;
  355.  
  356.     floatSliderGrp
  357.         -h 25
  358.         -label "Roughness"
  359.         -field true
  360.         -value 0.5
  361.         -min 0.0 -max 1.0
  362.         -pre 4
  363.         phongRoughness;
  364.  
  365.     floatSliderGrp
  366.         -h 25
  367.         -label "Highlight Size"
  368.         -field true
  369.         -value 0.5
  370.         -min 0.0 -max 1.0
  371.         -pre 4
  372.         phongHighlightSize;
  373.  
  374.     colorSliderGrp
  375.         -h 25
  376.         -label "Whiteness"
  377.         -rgb 0.5 0.5 0.5
  378.         phongWhitenessRGB;
  379.  
  380.     //    Turn off the wait cursor.
  381.     //
  382.     waitCursor -state 0;
  383.     
  384.     //    Step 5: Deactivate the default UI template.
  385.     //  ===========================================
  386.     //
  387.     setUITemplate -popTemplate;
  388.  
  389.     //    Step 6: Customize the buttons.  
  390.     //    ==============================
  391.     //
  392.     //    Provide more descriptive labels for the buttons.  This is not 
  393.     //    necessary, but in some cases, for example, a button labelled 
  394.     //    'Create' may be more meaningful to the user than one labelled
  395.     //    'Apply'.
  396.     //
  397.     //  Disable those buttons that are not applicable to the option box.
  398.     //
  399.     //    Attach actions to those buttons that are applicable to the option
  400.     //    box.  Note that the 'Close' button has a default action attached 
  401.     //    to it that will hide the window.  If a a custom action is
  402.     //    attached to the 'Close' button then be sure to call the 'hide the
  403.     //    option box' procedure within the custom action so that the option
  404.     //    box is hidden properly.
  405.  
  406.     //    'Apply' button.
  407.     //
  408.     string $applyBtn = getOptionBoxApplyBtn();
  409.     button -edit -label "Create"
  410.         -command ($callback + " " + $parent + " " + 1)
  411.         $applyBtn;
  412.  
  413.     //    'Save' button.
  414.     //
  415.     string $saveBtn = getOptionBoxSaveBtn();
  416.     button -edit 
  417.         -command ($callback + " " + $parent + " " + 0 + "; hideOptionBox")
  418.         $saveBtn;
  419.  
  420.     //    'Reset' button.
  421.     //
  422.     string $resetBtn = getOptionBoxResetBtn();
  423.     button -edit 
  424.         -command ($setup + " " + $parent + " " + 1)
  425.         $resetBtn;
  426.  
  427.     //    Step 7: Set the option box title.
  428.     //    =================================
  429.     //
  430.     setOptionBoxTitle("Create Phong Shader Options");
  431.  
  432.     //    Step 8: Customize the 'Help' menu item text.
  433.     //    ============================================
  434.     //
  435.     setOptionBoxHelpTag( "" );
  436.  
  437.     //    Step 9: Set the current values of the option box.
  438.     //    =================================================
  439.     //
  440.     eval (($setup + " " + $parent + " " + 0));    
  441.     
  442.     //    Step 10: Show the option box.
  443.     //    =============================
  444.     //
  445.     showOptionBox();
  446. }
  447.  
  448. proc string getCmd()
  449. {
  450.     string $cmd;
  451.  
  452.     setOptionVars( false );
  453.  
  454.     float $red = `optionVar -query phongRed`;
  455.     float $green = `optionVar -query phongGreen`;
  456.     float $blue = `optionVar -query phongBlue`;
  457.     float $transR = `optionVar -query phongTransRed`;
  458.     float $transG = `optionVar -query phongTransGreen`;
  459.     float $transB = `optionVar -query phongTransBlue`;
  460.     float $ambR = `optionVar -query phongAmbientRed`;
  461.     float $ambG = `optionVar -query phongAmbientGreen`;
  462.     float $ambB = `optionVar -query phongAmbientBlue`;
  463.     float $incandR = `optionVar -query phongIncandRed`;
  464.     float $incandG = `optionVar -query phongIncandGreen`;
  465.     float $incandB = `optionVar -query phongIncandBlue`;
  466.     float $specR = `optionVar -query phongSpecularRed`;
  467.     float $specG = `optionVar -query phongSpecularGreen`;
  468.     float $specB = `optionVar -query phongSpecularBlue`;
  469.     float $cosinePower = `optionVar -query phongCosinePower`;
  470.     float $roughness = `optionVar -query phongRoughness`;
  471.     float $highlightSize = `optionVar -query phongHighlightSize`;
  472.     float $whitenessR = `optionVar -query phongWhitenessRed`;
  473.     float $whitenessG = `optionVar -query phongWhitenessGreen`;
  474.     float $whitenessB = `optionVar -query phongWhitenessBlue`;
  475.     float $reflectivity = `optionVar -query phongReflectivity`;
  476.  
  477.     $cmd = "{string $result;";
  478.  
  479.     string $phongType = `optionVar -query phongType`;
  480.     if( $phongType == "regularPhong" ) {
  481.         $cmd = $cmd + "$result = `shadingNode -asShader phong`;";
  482.     } else {
  483.         $cmd = $cmd + "$result = `shadingNode -asShader phongE`;";
  484.     }
  485.  
  486.     $cmd = $cmd + "string $SEName = `sets -renderable true -name ($result+\"Grp\") -empty`;";
  487.     $cmd = $cmd + "connectAttr -f ( $result + \".outColor\") ( $SEName + \".surfaceShader\" );";
  488.  
  489. //     string $SEName = `sets -renderable true -name ($result+"Grp") -empty`;
  490. //     connectAttr -f ( $result+".outColor" ) ( $SEName+".surfaceShader" );
  491.  
  492.     //    Set the attributes the from the optionVars set
  493.     //    in the optionBox
  494.     //
  495.     $cmd = $cmd + "setAttr ( $result+\".colorR\" ) " + $red + ";";
  496.     $cmd = $cmd + "setAttr ( $result+\".colorG\" ) " + $green + ";";
  497.     $cmd = $cmd + "setAttr ( $result+\".colorB\" ) " + $blue + ";";
  498.     $cmd = $cmd + "setAttr ( $result+\".transparencyR\" ) " + $transR + ";";
  499.     $cmd = $cmd + "setAttr ( $result+\".transparencyG\" ) " + $transG + ";";
  500.     $cmd = $cmd + "setAttr ( $result+\".transparencyB\" ) " + $transB + ";";
  501.     $cmd = $cmd + "setAttr ( $result+\".ambientColorR\" ) " + $ambR + ";";
  502.     $cmd = $cmd + "setAttr ( $result+\".ambientColorG\" ) " + $ambG + ";";
  503.     $cmd = $cmd + "setAttr ( $result+\".ambientColorB\" ) " + $ambB + ";";
  504.     $cmd = $cmd + "setAttr ( $result+\".incandescenceR\" ) " + $incandR + ";";
  505.     $cmd = $cmd + "setAttr ( $result+\".incandescenceG\" ) " + $incandG + ";";
  506.     $cmd = $cmd + "setAttr ( $result+\".incandescenceB\" ) " + $incandB + ";";
  507.     $cmd = $cmd + "setAttr ( $result+\".specularColorR\" ) " + $specR + ";";
  508.     $cmd = $cmd + "setAttr ( $result+\".specularColorG\" ) " + $specG + ";";
  509.     $cmd = $cmd + "setAttr ( $result+\".specularColorB\" ) " + $specB + ";";
  510.     if( $phongType == "regularPhong" ) {
  511.         $cmd = $cmd + "setAttr ( $result+\".cosinePower\" ) " + $cosinePower + ";";
  512.     } else {
  513.         $cmd = $cmd + "setAttr ( $result+\".roughness\" ) " + $roughness + ";";
  514.         $cmd = $cmd + "setAttr ( $result+\".highlightSize\" ) " + $highlightSize + ";";
  515.         $cmd = $cmd + "setAttr ( $result+\".whitenessR\" ) " + $whitenessR + ";";
  516.         $cmd = $cmd + "setAttr ( $result+\".whitenessG\" ) " + $whitenessG + ";";
  517.         $cmd = $cmd + "setAttr ( $result+\".whitenessB\" ) " + $whitenessB + ";";
  518.     }
  519.     $cmd = $cmd + "setAttr ( $result+\".reflectivity\" ) " + $reflectivity + ";";
  520.     
  521.     $cmd = $cmd + "}";
  522.  
  523.     return $cmd;
  524. }
  525.  
  526. global proc string performCreatePhong (int $showOptionBox)
  527. {
  528.     string $cmd;
  529.  
  530.     if ($showOptionBox == 0) {
  531.         $cmd = getCmd();
  532.         eval($cmd);
  533.     } else if ( $showOptionBox == 1) {
  534.         createPhongOptions;
  535.     } else if ($showOptionBox == 2) {
  536.         $cmd = getCmd();
  537.     }
  538.     return $cmd;
  539. }
  540.  
  541.